package info.techgeek.labs.java5Features.thread.pripority;

import java.util.Random;

public class NormalExecutorTest {

        public static void main(String[] args) {
        
                NormalExecutor executor = new NormalExecutor();
                executor.start();
                
                // wait 1 second for executor starting
                try {
                        Thread.sleep(1000);
                } catch (InterruptedException e) {
                }
                
                for (int j = 0; j< 10; j++){
                        Random random = new Random();  
                        for (int i = 0; i < 100; i++)  
                        {  
                                TaskPriorityLevel randomX = TaskPriorityLevel.values()[random.nextInt(TaskPriorityLevel.values().length)];
                                executor.submitTask(new SamplePriorityTask(randomX,System.nanoTime()));
                        }  
                        try {
                                Thread.sleep(100);
                        } catch (InterruptedException e) {
                        }
                }
        }

}

